import { request } from '@/utils/request';

/**
 *
 * @returns 树形结构的组织
 */
export function getOrgTree() {
  return request.get({ url: '/org/tree' });
}

/**
 * 查询单个的信息
 */
export function getOrgById(id?: string) {
  return request.get({ url: `/org/${id}` });
}

/**
 * 添加机构
 */
export function addOrg(data: any) {
  return request.post({ url: '/org', data });
}

/**
 * 修改机构
 */
export function updateOrg(data: any) {
  return request.put({ url: '/org', data });
}

/**
 * 删除机构
 */
export function deleteOrg(id: string) {
  return request.delete({ url: `/org/${id}` });
}
